import request from '@/utils/request'
export const reqGetEmployees = params => request({
  url: '/sys/user',
  params
})
// 删除员工
export const reqDelEmployee = id => request({
  method: 'delete',
  url: `/sys/user/${id}`
})
// 新增员工
export const reqAddEmployee = data => request({
  method: 'post',
  url: '/sys/user',
  data
})
// 查看员工
export const reqGetDetail = id => request({
  url: `/sys/user/${id}`

})
// 修改员工信息
export const reqUpdateDetail = data => request({
  method: 'put',
  url: `/sys/user/${data.id}`,
  data
})
// excel导出
export const reqExportExcel = () => request({
  url: '/sys/user/export',
  responseType: 'blob' // 指定这个接口的响应数据类型为blob类型
})
// 下载模板
export const reqExcelTemplate = () => request({

  url: '/sys/user/import/template',
  responseType: 'blob' // 指定这个接口的响应数据类型为blob类型

})
// 员工导入
export const reqImportExcel = data => request({
  method: 'post',
  url: '/sys/user/import',
  data
})
export const reqAssignRole = (id, roleIds) => request({
  method: 'put',
  url: '/sys/user/assignRoles',
  data: {
    id,
    roleIds
  }
})

